{include file="head" /}



<!-- 编辑器引入结束 -->

{include file="menu" /}


<!--main content start-->
      <section id="main-content">
          <section class="wrapper">


          <div class="row">
                  <div class="col-sm-12">
                      <aside class="profile-info col-lg-9">
                      <section class="panel">

                          <div class="panel-body bio-graph-info">
                              <h1> 添加管理员</h1>
                              <form class="form-horizontal" role="form" method="post" id="formid">

                                  <div class="form-group">
                                      <label class="col-lg-2 control-label">用户名</label>
                                      <div class="col-lg-6">
                                          <input type="text" class="form-control" name="nickname"  value="{$username?$username:''}"  >
                                      </div>
                                  </div>




									{if isset($isedit) && $isedit == 1}

									               <input type="hidden" value="{$uid}" name="uid">
								                

                                  <div class="form-group">
                                      <label class="col-lg-2 control-label">新密码</label>
                                      <div class="col-lg-6">
                                          <input type="text" class="form-control"  value="" name="upwd">
                                      </div>
                                  </div>

                                  <div class="form-group">
                                      <label class="col-lg-2 control-label">确认密码</label>
                                      <div class="col-lg-6">
                                          <input type="text" class="form-control"  value="" name="upwd2">
                                      </div>
                                  </div>
                                  <input type="hidden" class="form-control"  value="{$uid}" name="uid">
								{else/}
								                  <div class="form-group">
                                      <label class="col-lg-2 control-label">密码</label>
                                      <div class="col-lg-6">
                                          <input type="text" class="form-control"  value="" name="upwd">
                                      </div>
                                  </div>

                                  <div class="form-group">
                                      <label class="col-lg-2 control-label">确认密码</label>
                                      <div class="col-lg-6">
                                          <input type="text" class="form-control"  value="" name="upwd2">
                                      </div>
                                  </div>
                                  <input type="hidden" class="form-control"  value="" name="ordpwd">
								{/if}





                                  <div class="form-group">
                                      <div class="col-lg-offset-2 col-lg-10">
                                          <input type="submit" value="提交"  onclick="return editcon(this.form)" class="btn btn-success">

                                      </div>
                                  </div>

                              </form>
                          </div>
                      </section>

                  </aside>
                  </div>

          </div>




          </section>
      </section>
      <!--main content end-->
  </section>


{include file="foot" /}
<script type="text/javascript" src="/static/public/umeditor/umindex.js"></script>
<script>

	function editcon(form){


		var otype = "{:input('param.otype')}";
    var type = "{$isedit?$isedit:'0'}";

    var nickname = form.nickname.value;
    var upwd = form.upwd.value;
    var upwd2 = form.upwd2.value;


    if(!nickname){layer.msg('请输入用户名'); return false;}
    if(type == 0 || (type == 1 && upwd)){
      if(!upwd){layer.msg('请输入密码'); return false;}
      if(upwd.length < 6){layer.msg('密码长度大于6位'); return false;}
      if(!upwd2){layer.msg('请再输入密码'); return false;}
      if(upwd !== upwd2){layer.msg('两次输入密码不同'); return false;}
    }




    var formurl = "{:Url('system/adminadd')}";
    var data = $('#formid').serialize();
    var locurl = "{:Url('system/adminlist')}";

    WPpost(formurl,data,locurl);

    return false;
	}


</script>
